/**************************************************************************************
 *
 * @(#) Content.java
 * @Package com.jgdt.jgdtkasannong_university_gene_backend.controller
 **************************************************************************************/
package com.jgdt.jgdtkasannong_university_gene_backend.controller.content;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jgdt.jgdtkasannong_university_gene_backend.biz.content.BaseBiz;
import com.jgdt.jgdtkasannong_university_gene_backend.common.response.PageRequest;
import com.jgdt.jgdtkasannong_university_gene_backend.common.response.ResultVo;
import com.jgdt.jgdtkasannong_university_gene_backend.vo.base.*;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @description: 基地内容-控制层
 * @author: huangAn
 * @createDate: 2025/04/24
 */
@Tag(name = "基地模块",description = "菜单模块")
@RestController
@RequestMapping("/api/base/info")
public class BaseContentController {

    @Autowired
    private BaseBiz baseBiz;

    /**
     * 根据菜单返回基地区域标识
     * @return
     */
    @Operation(summary = "根据菜单返回基地区域标识", description = "根据菜单返回基地区域标识")
    @GetMapping("/queryBaseRegionByMenu")
    public ResultVo<List<BaseRegionVo>> queryBaseRegionByMenu(@RequestParam Integer menuId){
        return ResultVo.success(baseBiz.queryBaseRegionByMenu(menuId));
    }

    /**
     * 根据区域id查询区域信息
     * @return
     */
    @Operation(summary = "根据区域id查询区域信息", description = "根据区域id查询区域信息")
    @GetMapping("/queryRegionInfoById")
    public ResultVo<RegionInfoVo> queryRegionInfoById(@RequestParam Integer regionId){
        return ResultVo.success(baseBiz.queryRegionInfoById(regionId));
    }

    /**
     * 根据基地id查询基地信息
     * @return
     */
    @Operation(summary = "根据基地id查询基地信息", description = "根据基地id查询基地信息")
    @PostMapping("/queryBaseInfoById")
    public ResultVo<BaseInfoVo> queryBaseInfoById(@RequestBody PageRequest<QueryBaseInfoByIdParameter> page){
        return ResultVo.success(baseBiz.queryBaseInfoById(page));
    }


    /**
     * 根据基地id分页查询基地视频信息
     * @return
     */
    @Operation(summary = "根据基地id分页查询基地视频信息", description = "根据基地id分页查询基地视频信息")
    @PostMapping("/queryCameraDeviceVoPage")
    public ResultVo<IPage<CameraDeviceVo>> queryCameraDeviceVoPage(@RequestBody PageRequest<QueryBaseInfoByIdParameter> page){
        return ResultVo.success(baseBiz.queryCameraDeviceVoPage(page));
    }


}




